package com.choudou5.web;

import com.choudou5.bo.UDeskBo;
import com.choudou5.service.UDeskService;
import com.choudou5.utils.JsonUtil;
import com.choudou5.utils.LogUtil;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.util.Map;


@RestController
@RequestMapping("/udesk")
public class UDeskController extends BaseController {

	@Resource
	private UDeskService uDeskService;

    @RequestMapping("ivr/callback")
    @ResponseBody
    public String ivrCallback(HttpServletRequest req){
        UDeskBo bo = buildBo(req, UDeskBo.class);
        Map result = uDeskService.findOrderInfo(bo);
        LogUtil.debug("返回结果：", result);
    	return JsonUtil.toStr(result);
    }

}
